package com.example.demo.dto;

import lombok.Data;

/**
 * @author gsq
 * @date 2025/3/10 15:09
 */
@Data
public class Quote {
    // 股票代码
    private String symbol;
    // 代码
    private String code;
    // 交易所
    private String exchange;
    // 名称
    private String name;
    // 类型
    private Integer type;
    // 子类型
    private Object subType;
    // 状态
    private Integer status;
    // 当前价格
    private Double current;
    // 货币类型
    private String currency;
    // 涨跌幅百分比
    private Double percent;
    // 涨跌额
    private Double chg;
    // 时间戳
    private Long timestamp;
    // 时间
    private Long time;
    // 每手股数
    private Integer lotSize;
    // 最小变动价位
    private Double tickSize;
    // 开盘价
    private Double open;
    // 昨日收盘价
    private Double lastClose;
    // 最高价
    private Double high;
    // 最低价
    private Double low;
    // 平均价格
    private Double avgPrice;
    // 成交量
    private Long volume;
    // 成交额
    private Double amount;
    // 换手率
    private Double turnoverRate;
    // 振幅
    private Double amplitude;
    // 总市值
    private Double marketCapital;
    // 流通市值
    private Double floatMarketCapital;
    // 总股本
    private Long totalShares;
    // 流通股本
    private Long floatShares;
    // 上市日期
    private Long issueDate;
    // 锁定集合
    private Integer lockSet;
    // 今年以来涨跌幅
    private Double currentYearPercent;
    // 52周最高价
    private Double high52w;
    // 52周最低价
    private Double low52w;
    // 上涨家数
    private Integer riseCount;
    // 平盘家数
    private Integer flatCount;
    // 下跌家数
    private Integer fallCount;
    // 量比
    private Double volumeRatio;

    public String toFullString() {
        return name + "(" + symbol + "): " + "\n当前价格：" + current + "\n涨跌幅：" + percent + "%" + "\n涨跌额：" + chg
                + "\n开盘价：" + open + "\n昨日收盘价：" + lastClose + "\n最高价：" + high + "\n最低价：" + low + "\n平均价格：" + avgPrice
                + "\n成交量：" + volume + "\n成交额：" + amount + "\n换手率：" + turnoverRate + "\n振幅：" + amplitude
                + "\n总市值：" + marketCapital + "\n流通市值：" + floatMarketCapital + "\n总股本：" + totalShares
                + "\n流通股本：" + floatShares + "\n上市日期：" + issueDate + "\n锁定集合：" + lockSet
                + "\n今年以来涨跌幅：" + currentYearPercent + "\n52周最高价：" + high52w + "\n52周最低价：" + low52w
                + "\n上涨家数：" + riseCount + "\n平盘家数：" + flatCount + "\n下跌家数：" + fallCount + "\n量比：" + volumeRatio;
    }

    public String toSummaryString() {
        return name + "(" + symbol + "): " + "当前价格：" + current + " 涨跌幅：" + percent + "%" + " 涨跌额：" + chg;
    }
}
